<?php
	require_once '../func/admin_func.php';
	$choice = new admin();
	if(isset($_POST['pager'])){
		$pager = $_POST['pager'];
	}else{
		$pager = 1;
	}
	$data = $choice->GetChoiceList($pager);
	$n = count($data);
	$i = 0;
?>

<div id="main-wrapper">
<h1>选课信息管理</h1>
<a class="search-button" href="#">高级搜索</a><div class="search-form" style="display: none;">
<div class="wide form">
</div>
</div>
<div id="user-account-grid" class="grid-view">
<div class="summary">共<?php echo $m =  $choice->info_count('sign');?>条.</div>
<table class="items">
<thead>
<tr>
	<th></th>
	<th id="user-account-grid_c1"><a href="">学生学号</a></th>
	<th id="user-account-grid_c2"><a href="">学生姓名</a></th>
	<th id="user-account-grid_c1"><a href="">课程号</a></th>
	<th id="user-account-grid_c2"><a href="">课序号</a></th>
	<th id="user-account-grid_c3"><a href="">课程名</a></th>
	<th id="user-account-grid_c4"><a href="">任课老师</a></th>
	<th id="user-account-grid_c5"><a href="">上课地点</a></th>
	<th id="user-account-grid_c6"><a href="">上课时间</a></th>
	<th id="user-account-grid_c7"><a href="">上课周次</a></th>
	<th id="user-account-grid_c8"><a href="">选课状态</a></th>
	<th id="user-account-grid_c9"><a href="">操作</a></th>
</tr>
</thead>
<tbody id="tbody">
<?php
	while($i<$n){
?>
<tr class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
<td></td>
<td><?php echo $data[$i]['student']['s_num'];?></td>
<td><?php echo $data[$i]['student']['s_name'];?></td>
<td><?php echo $data[$i]['course']['c_num'];?></td>
<td><?php echo $data[$i]['course']['c_serialnum'];?></td>
<td><?php echo $data[$i]['course']['c_name'];?></td>
<td><?php echo $data[$i]['course']['t_name'];?></td>
<td><?php echo $data[$i]['course']['c_address'];?></td>
<td><?php echo $data[$i]['course']['c_time'];?></td>
<td><?php echo $data[$i]['course']['weeks'];?></td>
<td><?php echo $data[$i]['status'];?></td>
<td>
<a class="update" title="更新" href="#" onclick="operate('sign',<?php echo $data[$i]['id'].",".$pager;?>,'update')"><img src="./images/update.png" alt="更新"></a> 
<a class="delete" title="删除" href="#" onclick="operate('sign',<?php echo $data[$i]['id'].",".$pager;?>,'del')" ><img src="./images/delete.png" alt="删除"></a></td></tr>
<?php $i++;}?>
</tbody>
</table>
<div class="pager">
<script>$('.pager').load("./pager.php",{type:'choice',pager:<?php echo $pager;?>}); </script>
</div>
<div class="keys" style="display: none;" title="/users/useraccount/admin"><span>1278</span><span>1277</span><span>1276</span><span>1275</span><span>1274</span><span>1273</span><span>1272</span><span>1271</span><span>1270</span><span>1269</span><span>1268</span><span>1267</span></div>
</div>	
</div>